package com.beiing.tianshuai.tianshuai.entity;

import android.support.annotation.NonNull;

/**
 * Created by emaiba on 2017/6/13.
 */

public class ConversationListInfo implements Comparable<ConversationListInfo> {

    private String lastMessage;
    private int type;
    private long time;
    private String uid;
    private String avatar;
    private String nickname;
    private int unreadMessageCount;

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public int getUnreadMessageCount() {
        return unreadMessageCount;
    }

    public void setUnreadMessageCount(int unreadMessageCount) {
        this.unreadMessageCount = unreadMessageCount;
    }

    public String getLastMessage() {
        return lastMessage;
    }

    public void setLastMessage(String lastMessage) {
        this.lastMessage = lastMessage;
    }

    public int getChatType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    @Override
    public int compareTo(@NonNull ConversationListInfo o) {
        if (o.getTime() > this.getTime()) {
            return 1;
        } else if (o.getTime() < this.getTime()) {
            return -1;
        } else {
            return 0;
        }
    }

    @Override
    public String toString() {
        return "ConversationListInfo{" +
                "lastMessage='" + lastMessage + '\'' +
                ", type='" + type + '\'' +
                ", time=" + time +
                ", uid='" + uid + '\'' +
                ", unreadMessageCount=" + unreadMessageCount +
                '}';
    }
}